package it.polimi.comorazio.data;

import it.polimi.comorazio.data.DataBaseHelper.PointOfInterest;

import java.util.Arrays;
import java.util.List;

import android.database.Cursor;

public class PointOfInterestVo {

	private String address;
	private Double longitude;
	private Double latitude;
	private String description;
	private String name;
	private String year;
	private Integer id;
	private ImageVo image;

	public PointOfInterestVo(Cursor c, int position, String lang) {
		c.moveToPosition(position);
		List<String> columns = Arrays.asList(c.getColumnNames());
		id = c.getInt(columns.indexOf(PointOfInterest._ID));
		address = c.getString(columns.indexOf(PointOfInterest.COLUMN_ADDRESS));
		longitude = c.getDouble(columns
				.indexOf(PointOfInterest.COLUMN_LONGITUDE));
		latitude = c
				.getDouble(columns.indexOf(PointOfInterest.COLUMN_LATITUDE));
		description = c.getString(columns
				.indexOf(PointOfInterest.COLUMN_DESCRIPTION + lang));
		name = c.getString(columns.indexOf(PointOfInterest.COLUMN_NAME + lang));
		year = c.getString(columns.indexOf(PointOfInterest.COLUMN_YEAR));
	}

	@Override
	public String toString() {
		return "PointOfInterestVo [name=" + name + ", longitude=" + longitude
				+ ", latitude=" + latitude + ", address=" + address
				+ ", description=" + description + ", year=" + year + "]";
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public Double getLongitude() {
		return longitude;
	}

	public void setLongitude(Double longitude) {
		this.longitude = longitude;
	}

	public Double getLatitude() {
		return latitude;
	}

	public void setLatitude(Double latitude) {
		this.latitude = latitude;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getYear() {
		return year;
	}

	public void setYear(String year) {
		this.year = year;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public ImageVo getImage() {
		return image;
	}

	public void setImage(ImageVo image) {
		this.image = image;
	}

}
